﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.Diagnostics;
using Newtonsoft.Json;
using Hammock.Model;

namespace Weibo4Sharp.Model
{
    /// <summary>
    /// total number of all kinds of unread message
    /// </summary>
    [Serializable]
    [DataContract]
    [DebuggerDisplay("{Mentions}")]
    [JsonObject(MemberSerialization.OptIn)]
    public class WeiboUnread : PropertyChangedBase,
                               IWeiboModel
    {

        private int _comments;
        private int _followers;
        private int _newStatus;
        private int _directMessage;
        private int _mentions;

        [DataMember]
        public virtual int Comments
        {
            get { return _comments; }
            set
            {
                if (_comments == value)
                {
                    return;
                }

                _comments = value;

                OnPropertyChanged("Comments");
            }
        }

        [DataMember]
        public virtual int Mentions
        {
            get { return _mentions; }
            set
            {
                if (_mentions == value)
                {
                    return;
                }

                _mentions = value;

                OnPropertyChanged("Mentions");
            }
        }

        [DataMember]
        public virtual int Followers
        {
            get { return _followers; }
            set
            {
                if (_followers == value)
                {
                    return;
                }

                _followers = value;

                OnPropertyChanged("Followers");
            }
        }

        [DataMember]
        [JsonProperty("new_status")]
        public virtual int NewStatus
        {
            get { return _newStatus; }

            set
            {
                if (_newStatus ==    value)
                {
                    return;
                }

                _newStatus = value;

                OnPropertyChanged("NewStatus");
            }
        }

        [DataMember]
        [JsonProperty("dm")]
        public virtual int DirectMessage
        {
            get { return _directMessage; }

            set
            {
                if (_directMessage == value)
                {
                    return;
                }

                _directMessage = value;

                OnPropertyChanged("DirectMessage");
            }
        }

        public virtual string RawSource { get; set; }
    }
}
